$\mathit{RO}_\mathit{run}$ & {\tt memory/actual} & int & Guest's actual memory (bytes) \\
$\mathit{RO}_\mathit{run}$ & {\tt VCPUs/number} & int & Current number of VCPUs \\
$\mathit{RO}_\mathit{run}$ & {\tt VCPUs/utilisation} & (int $\rightarrow$ float) Map & Utilisation for all of guest's current VCPUs \\
+$\mathit{RO}_\mathit{run}$ & {\tt last\_updated} & datetime & Time at which this information was last updated \\
\hline
\end{longtable}
\subsection{RPCs associated with class: VM\_metrics}
}
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_last\_updated}
+
+{\bf Overview:}
+Get the last\_updated field of the given VM\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} datetime get_last_updated (session_id s, VM_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+datetime
+}
+
+
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
$\mathit{RO}_\mathit{run}$ & {\tt disks} & (string $\rightarrow$ string) Map & disk configuration/free space \\
$\mathit{RO}_\mathit{run}$ & {\tt networks} & (string $\rightarrow$ string) Map & network configuration \\
$\mathit{RO}_\mathit{run}$ & {\tt other} & (string $\rightarrow$ string) Map & anything else \\
+$\mathit{RO}_\mathit{run}$ & {\tt last\_updated} & datetime & Time at which this information was last updated \\
\hline
\end{longtable}
\subsection{RPCs associated with class: VM\_guest\_metrics}
}
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_last\_updated}
+
+{\bf Overview:}
+Get the last\_updated field of the given VM\_guest\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} datetime get_last_updated (session_id s, VM_guest_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM\_guest\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+datetime
+}
+
+
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
$\mathit{RO}_\mathit{run}$ & {\tt memory/total} & int & Host's total memory (bytes) \\
$\mathit{RO}_\mathit{run}$ & {\tt memory/free} & int & Host's free memory (bytes) \\
+$\mathit{RO}_\mathit{run}$ & {\tt last\_updated} & datetime & Time at which this information was last updated \\
\hline
\end{longtable}
\subsection{RPCs associated with class: host\_metrics}
}
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_last\_updated}
+
+{\bf Overview:}
+Get the last\_updated field of the given host\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} datetime get_last_updated (session_id s, host_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt host\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+datetime
+}
+
+
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
$\mathit{RO}_\mathit{run}$ & {\tt io/read\_kbs} & float & Read bandwidth (KiB/s) \\
$\mathit{RO}_\mathit{run}$ & {\tt io/write\_kbs} & float & Write bandwidth (KiB/s) \\
+$\mathit{RO}_\mathit{run}$ & {\tt last\_updated} & datetime & Time at which this information was last updated \\
\hline
\end{longtable}
\subsection{RPCs associated with class: VIF\_metrics}
}
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_last\_updated}
+
+{\bf Overview:}
+Get the last\_updated field of the given VIF\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} datetime get_last_updated (session_id s, VIF_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VIF\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+datetime
+}
+
+
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
$\mathit{RO}_\mathit{run}$ & {\tt io/read\_kbs} & float & Read bandwidth (KiB/s) \\
$\mathit{RO}_\mathit{run}$ & {\tt io/write\_kbs} & float & Write bandwidth (KiB/s) \\
+$\mathit{RO}_\mathit{run}$ & {\tt last\_updated} & datetime & Time at which this information was last updated \\
\hline
\end{longtable}
\subsection{RPCs associated with class: PIF\_metrics}
}
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_last\_updated}
+
+{\bf Overview:}
+Get the last\_updated field of the given PIF\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} datetime get_last_updated (session_id s, PIF_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt PIF\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+datetime
+}
+
+
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
$\mathit{RO}_\mathit{run}$ & {\tt io/read\_kbs} & float & Read bandwidth (KiB/s) \\
$\mathit{RO}_\mathit{run}$ & {\tt io/write\_kbs} & float & Write bandwidth (KiB/s) \\
+$\mathit{RO}_\mathit{run}$ & {\tt last\_updated} & datetime & Time at which this information was last updated \\
\hline
\end{longtable}
\subsection{RPCs associated with class: VBD\_metrics}
}
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_last\_updated}
+
+{\bf Overview:}
+Get the last\_updated field of the given VBD\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} datetime get_last_updated (session_id s, VBD_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VBD\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+datetime
+}
+
+
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
char *uuid;
int64_t memory_total;
int64_t memory_free;
+ time_t last_updated;
} xen_host_metrics_record;
/**
xen_host_metrics_get_memory_free(xen_session *session, int64_t *result, xen_host_metrics host_metrics);
+/**
+ * Get the last_updated field of the given host_metrics.
+ */
+extern bool
+xen_host_metrics_get_last_updated(xen_session *session, time_t *result, xen_host_metrics host_metrics);
+
+
/**
* Return a list of all the host_metrics instances known to the system.
*/
char *uuid;
double io_read_kbs;
double io_write_kbs;
+ time_t last_updated;
} xen_pif_metrics_record;
/**
xen_pif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_pif_metrics pif_metrics);
+/**
+ * Get the last_updated field of the given PIF_metrics.
+ */
+extern bool
+xen_pif_metrics_get_last_updated(xen_session *session, time_t *result, xen_pif_metrics pif_metrics);
+
+
/**
* Return a list of all the PIF_metrics instances known to the system.
*/
char *uuid;
double io_read_kbs;
double io_write_kbs;
+ time_t last_updated;
} xen_vbd_metrics_record;
/**
xen_vbd_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vbd_metrics vbd_metrics);
+/**
+ * Get the last_updated field of the given VBD_metrics.
+ */
+extern bool
+xen_vbd_metrics_get_last_updated(xen_session *session, time_t *result, xen_vbd_metrics vbd_metrics);
+
+
/**
* Return a list of all the VBD_metrics instances known to the system.
*/
char *uuid;
double io_read_kbs;
double io_write_kbs;
+ time_t last_updated;
} xen_vif_metrics_record;
/**
xen_vif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vif_metrics vif_metrics);
+/**
+ * Get the last_updated field of the given VIF_metrics.
+ */
+extern bool
+xen_vif_metrics_get_last_updated(xen_session *session, time_t *result, xen_vif_metrics vif_metrics);
+
+
/**
* Return a list of all the VIF_metrics instances known to the system.
*/
xen_string_string_map *disks;
xen_string_string_map *networks;
xen_string_string_map *other;
+ time_t last_updated;
} xen_vm_guest_metrics_record;
/**
xen_vm_guest_metrics_get_other(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
+/**
+ * Get the last_updated field of the given VM_guest_metrics.
+ */
+extern bool
+xen_vm_guest_metrics_get_last_updated(xen_session *session, time_t *result, xen_vm_guest_metrics vm_guest_metrics);
+
+
/**
* Return a list of all the VM_guest_metrics instances known to the
* system.
int64_t memory_actual;
int64_t vcpus_number;
xen_int_float_map *vcpus_utilisation;
+ time_t last_updated;
} xen_vm_metrics_record;
/**
xen_vm_metrics_get_vcpus_utilisation(xen_session *session, xen_int_float_map **result, xen_vm_metrics vm_metrics);
+/**
+ * Get the last_updated field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_last_updated(xen_session *session, time_t *result, xen_vm_metrics vm_metrics);
+
+
/**
* Return a list of all the VM_metrics instances known to the system.
*/
.offset = offsetof(xen_host_metrics_record, memory_total) },
{ .key = "memory_free",
.type = &abstract_type_int,
- .offset = offsetof(xen_host_metrics_record, memory_free) }
+ .offset = offsetof(xen_host_metrics_record, memory_free) },
+ { .key = "last_updated",
+ .type = &abstract_type_datetime,
+ .offset = offsetof(xen_host_metrics_record, last_updated) }
};
const abstract_type xen_host_metrics_record_abstract_type_ =
}
+bool
+xen_host_metrics_get_last_updated(xen_session *session, time_t *result, xen_host_metrics host_metrics)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = host_metrics }
+ };
+
+ abstract_type result_type = abstract_type_datetime;
+
+ XEN_CALL_("host_metrics.get_last_updated");
+ return session->ok;
+}
+
+
bool
xen_host_metrics_get_all(xen_session *session, struct xen_host_metrics_set **result)
{
.offset = offsetof(xen_pif_metrics_record, io_read_kbs) },
{ .key = "io_write_kbs",
.type = &abstract_type_float,
- .offset = offsetof(xen_pif_metrics_record, io_write_kbs) }
+ .offset = offsetof(xen_pif_metrics_record, io_write_kbs) },
+ { .key = "last_updated",
+ .type = &abstract_type_datetime,
+ .offset = offsetof(xen_pif_metrics_record, last_updated) }
};
const abstract_type xen_pif_metrics_record_abstract_type_ =
}
+bool
+xen_pif_metrics_get_last_updated(xen_session *session, time_t *result, xen_pif_metrics pif_metrics)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = pif_metrics }
+ };
+
+ abstract_type result_type = abstract_type_datetime;
+
+ XEN_CALL_("PIF_metrics.get_last_updated");
+ return session->ok;
+}
+
+
bool
xen_pif_metrics_get_all(xen_session *session, struct xen_pif_metrics_set **result)
{
.offset = offsetof(xen_vbd_metrics_record, io_read_kbs) },
{ .key = "io_write_kbs",
.type = &abstract_type_float,
- .offset = offsetof(xen_vbd_metrics_record, io_write_kbs) }
+ .offset = offsetof(xen_vbd_metrics_record, io_write_kbs) },
+ { .key = "last_updated",
+ .type = &abstract_type_datetime,
+ .offset = offsetof(xen_vbd_metrics_record, last_updated) }
};
const abstract_type xen_vbd_metrics_record_abstract_type_ =
}
+bool
+xen_vbd_metrics_get_last_updated(xen_session *session, time_t *result, xen_vbd_metrics vbd_metrics)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vbd_metrics }
+ };
+
+ abstract_type result_type = abstract_type_datetime;
+
+ XEN_CALL_("VBD_metrics.get_last_updated");
+ return session->ok;
+}
+
+
bool
xen_vbd_metrics_get_all(xen_session *session, struct xen_vbd_metrics_set **result)
{
.offset = offsetof(xen_vif_metrics_record, io_read_kbs) },
{ .key = "io_write_kbs",
.type = &abstract_type_float,
- .offset = offsetof(xen_vif_metrics_record, io_write_kbs) }
+ .offset = offsetof(xen_vif_metrics_record, io_write_kbs) },
+ { .key = "last_updated",
+ .type = &abstract_type_datetime,
+ .offset = offsetof(xen_vif_metrics_record, last_updated) }
};
const abstract_type xen_vif_metrics_record_abstract_type_ =
}
+bool
+xen_vif_metrics_get_last_updated(xen_session *session, time_t *result, xen_vif_metrics vif_metrics)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vif_metrics }
+ };
+
+ abstract_type result_type = abstract_type_datetime;
+
+ XEN_CALL_("VIF_metrics.get_last_updated");
+ return session->ok;
+}
+
+
bool
xen_vif_metrics_get_all(xen_session *session, struct xen_vif_metrics_set **result)
{
.offset = offsetof(xen_vm_guest_metrics_record, networks) },
{ .key = "other",
.type = &abstract_type_string_string_map,
- .offset = offsetof(xen_vm_guest_metrics_record, other) }
+ .offset = offsetof(xen_vm_guest_metrics_record, other) },
+ { .key = "last_updated",
+ .type = &abstract_type_datetime,
+ .offset = offsetof(xen_vm_guest_metrics_record, last_updated) }
};
const abstract_type xen_vm_guest_metrics_record_abstract_type_ =
}
+bool
+xen_vm_guest_metrics_get_last_updated(xen_session *session, time_t *result, xen_vm_guest_metrics vm_guest_metrics)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm_guest_metrics }
+ };
+
+ abstract_type result_type = abstract_type_datetime;
+
+ XEN_CALL_("VM_guest_metrics.get_last_updated");
+ return session->ok;
+}
+
+
bool
xen_vm_guest_metrics_get_all(xen_session *session, struct xen_vm_guest_metrics_set **result)
{
.offset = offsetof(xen_vm_metrics_record, vcpus_number) },
{ .key = "VCPUs_utilisation",
.type = &abstract_type_int_float_map,
- .offset = offsetof(xen_vm_metrics_record, vcpus_utilisation) }
+ .offset = offsetof(xen_vm_metrics_record, vcpus_utilisation) },
+ { .key = "last_updated",
+ .type = &abstract_type_datetime,
+ .offset = offsetof(xen_vm_metrics_record, last_updated) }
};
const abstract_type xen_vm_metrics_record_abstract_type_ =
}
+bool
+xen_vm_metrics_get_last_updated(xen_session *session, time_t *result, xen_vm_metrics vm_metrics)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm_metrics }
+ };
+
+ abstract_type result_type = abstract_type_datetime;
+
+ XEN_CALL_("VM_metrics.get_last_updated");
+ return session->ok;
+}
+
+
bool
xen_vm_metrics_get_all(xen_session *session, struct xen_vm_metrics_set **result)
{
return;
}
+ char time[256];
+ struct tm *tm = localtime(&vm_metrics_record->last_updated);
+ strftime(time, 256, "Metrics updated at %c, local time.\n", tm);
+ printf(time);
+
for (size_t i = 0; i < vm_metrics_record->vcpus_utilisation->size; i++)
{
printf("%"PRId64" -> %lf.\n",
import sys
import traceback
import threading
+import time
+import xmlrpclib
from xen.xend import XendDomain, XendDomainInfo, XendNode, XendDmesg
from xen.xend import XendLogging, XendTaskManager
"""Temporary method to make sure we track down all the TODOs"""
return {"Status": "Error", "ErrorDescription": XEND_ERROR_TODO}
+
+def now():
+ return xmlrpclib.DateTime(time.strftime("%Y%m%dT%H:%M:%S", time.gmtime()))
+
+
# ---------------------------------------------------
# Python Method Decorators for input value validation
# ---------------------------------------------------
# ----------------------------------------------------------------
host_metrics_attr_ro = ['memory_total',
- 'memory_free']
+ 'memory_free',
+ 'last_updated']
host_metrics_attr_rw = []
host_metrics_methods = []
'uuid' : ref,
'memory_total' : self._host_metrics_get_memory_total(),
'memory_free' : self._host_metrics_get_memory_free(),
+ 'last_updated' : now(),
})
- def host_metrics_get_memory_total(self, _, ref):
+ def host_metrics_get_memory_total(self, _1, _2):
return xen_api_success(self._host_metrics_get_memory_total())
- def host_metrics_get_memory_free(self, _, ref):
+ def host_metrics_get_memory_free(self, _1, _2):
return xen_api_success(self._host_metrics_get_memory_free())
+ def host_metrics_get_last_updated(self, _1, _2):
+ return xen_api_success(now())
+
def _host_metrics_get_memory_total(self):
node = XendNode.instance()
return node.xc.physinfo()['total_memory'] * 1024
# ----------------------------------------------------------------
PIF_metrics_attr_ro = ['io_read_kbs',
- 'io_write_kbs']
+ 'io_write_kbs',
+ 'last_updated']
PIF_metrics_attr_rw = []
PIF_methods = []
def PIF_metrics_get_io_write_kbs(self, _, ref):
return xen_api_success(self._PIF_metrics_get(ref).get_io_write_kbs())
+ def PIF_metrics_get_last_updated(self, _1, _2):
+ return xen_api_success(now())
+
# Xen API: Class VM
# ----------------------------------------------------------------
'VCPUs_flags',
'VCPUs_params',
'state',
- 'start_time']
+ 'start_time',
+ 'last_updated']
VM_metrics_attr_rw = []
VM_metrics_methods = []
def VM_metrics_get_state(self, _, ref):
return xen_api_success(self._VM_metrics_get(ref).get_state())
+ def VM_metrics_get_last_updated(self, _1, _2):
+ return xen_api_success(now())
+
# Xen API: Class VBD
# ----------------------------------------------------------------
# ----------------------------------------------------------------
VBD_metrics_attr_ro = ['io_read_kbs',
- 'io_write_kbs']
+ 'io_write_kbs',
+ 'last_updated']
VBD_metrics_attr_rw = []
VBD_methods = []
return xen_api_error(['HANDLE_INVALID', 'VBD_metrics', ref])
return xen_api_success(
{ 'io_read_kbs' : vm.get_dev_property('vbd', ref, 'io_read_kbs'),
- 'io_write_kbs' : vm.get_dev_property('vbd', ref, 'io_write_kbs') })
+ 'io_write_kbs' : vm.get_dev_property('vbd', ref, 'io_write_kbs'),
+ 'last_updated' : now()
+ })
def VBD_metrics_get_io_read_kbs(self, _, ref):
return self._VBD_get(ref, 'io_read_kbs')
def VBD_metrics_get_io_write_kbs(self, session, ref):
return self._VBD_get(ref, 'io_write_kbs')
+ def VBD_metrics_get_last_updated(self, _1, _2):
+ return xen_api_success(now())
+
# Xen API: Class VIF
# ----------------------------------------------------------------
# ----------------------------------------------------------------
VIF_metrics_attr_ro = ['io_read_kbs',
- 'io_write_kbs']
+ 'io_write_kbs',
+ 'last_updated']
VIF_metrics_attr_rw = []
VIF_methods = []
return xen_api_error(['HANDLE_INVALID', 'VIF_metrics', ref])
return xen_api_success(
{ 'io_read_kbs' : vm.get_dev_property('vif', ref, 'io_read_kbs'),
- 'io_write_kbs' : vm.get_dev_property('vif', ref, 'io_write_kbs') })
+ 'io_write_kbs' : vm.get_dev_property('vif', ref, 'io_write_kbs'),
+ 'last_updated' : now()
+ })
def VIF_metrics_get_io_read_kbs(self, _, ref):
return self._VIF_get(ref, 'io_read_kbs')
def VIF_metrics_get_io_write_kbs(self, session, ref):
return self._VIF_get(ref, 'io_write_kbs')
+ def VIF_metrics_get_last_updated(self, _1, _2):
+ return xen_api_success(now())
+
# Xen API: Class VDI
# ----------------------------------------------------------------
synchronous_method_name,
session)
return xen_api_success(task_uuid)
-
-#
-# Auto generate some stubs based on XendAPI introspection
-#
-if __name__ == "__main__":
- def output(line):
- print ' ' + line
-
- classes = ['VDI', 'SR']
- for cls in classes:
- ro_attrs = getattr(XendAPI, '%s_attr_ro' % cls, [])
- rw_attrs = getattr(XendAPI, '%s_attr_rw' % cls, [])
- methods = getattr(XendAPI, '%s_methods' % cls, [])
- funcs = getattr(XendAPI, '%s_funcs' % cls, [])
-
- ref = '%s_ref' % cls
-
- for attr_name in ro_attrs + rw_attrs + XendAPI.Base_attr_ro:
- getter_name = '%s_get_%s' % (cls, attr_name)
- output('def %s(self, session, %s):' % (getter_name, ref))
- output(' return xen_api_todo()')
-
- for attr_name in rw_attrs + XendAPI.Base_attr_rw:
- setter_name = '%s_set_%s' % (cls, attr_name)
- output('def %s(self, session, %s, value):' % (setter_name, ref))
- output(' return xen_api_todo()')
-
- for method_name in methods + XendAPI.Base_methods:
- method_full_name = '%s_%s' % (cls,method_name)
- output('def %s(self, session, %s):' % (method_full_name, ref))
- output(' return xen_api_todo()')
-
- for func_name in funcs + XendAPI.Base_funcs:
- func_full_name = '%s_%s' % (cls, func_name)
- output('def %s(self, session):' % func_full_name)
- output(' return xen_api_todo()')
return 0.0
def get_record(self):
+ import xen.xend.XendAPI as XendAPI
return {'uuid' : self.uuid,
'PIF' : self.pif.uuid,
'io_read_kbs' : self.get_io_read_kbs(),
- 'io_write_kbs' : self.get_io_write_kbs()
+ 'io_write_kbs' : self.get_io_write_kbs(),
+ 'last_updated' : XendAPI.now(),
}
return self.xend_domain_instance.info.get("start_time", -1)
def get_record(self):
+ import xen.xend.XendAPI as XendAPI
return { 'uuid' : self.uuid,
'memory_actual' : self.get_memory_actual(),
'VCPUs_number' : self.get_VCPUs_number(),
'VCPUs_params' : self.get_VCPUs_params(),
'start_time' : self.get_start_time(),
'state' : self.get_state(),
+ 'last_updated' : XendAPI.now(),
}